package com.qingcheng.service.order;

import com.qingcheng.entity.PageResult;
import com.qingcheng.pojo.order.Myfavorite;

import java.util.*;

/**
 * myfavorite业务逻辑层
 */
public interface MyfavoriteService {


    public List<Myfavorite> findAll();


    public PageResult<Myfavorite> findPage(int page, int size);


    public List<Map<String, Object>> findList(String username);


    public PageResult<Myfavorite> findPage(Map<String, Object> searchMap, int page, int size);


    public Myfavorite findById(Integer id);

    public void add(String skuId, String username, Integer num);


    public void update(Myfavorite myfavorite);


    public void delete(Integer id);


    public void adds(String username);



    /**
     * 从redis中获取我的关注数据
     *
     * @param username
     * @return
     */
    public List<Map<String, Object>> findMyCollection(String username);


    /**
     * 删除单个关注
     * @param username
     * @param skuId
     */
    public void deleteMyCollectionOne(String username, String skuId);

    /**
     * 删除所有我的关注
     *
     * @param username
     */
    public void deleteMyCollection(String username);

    /**
     * 获取最新的我的关注列表
     *
     * @param username
     * @return
     */
//    public List<Map<String, Object>> findMyCollectionList(String skuId);

    /**
     * 更新单个选中状态
     * @param
     * @param skuId
     * @param username
     * @return
     */
    public boolean updateMyCollection(String username, String skuId);


    /**
     * 全选
     * @param username
     * @param checked
     */
    public void selectAll(String username, boolean checked);

    public void saveGoodsToCart(String username,String skuId, Integer num);

}
